package afeng.run.jenkinsdemodeploy.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import org.apache.tomcat.jni.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
@Api(tags = "用户管理相关接口")
public class UserLogin {

    @Autowired
    StringRedisTemplate stringRedisTemplate;

    @RequestMapping("/11")
    @ApiOperation("添加用户的接口")
    @ApiImplicitParam(name = "id", value = "用户id", defaultValue = "99", required = true)
    public String login(){
        return "jenkins搭建网站示例";
    }


    @RequestMapping("/hello")
    @ApiOperation("添加用户的接口")
    @ApiImplicitParam(name = "id", value = "用户id", defaultValue = "99", required = true)
    public String hello(String id){
        return "hello world@ 触发自动部署";
    }

    @RequestMapping("/add/{value}")
    public String add(@PathVariable("value")String value){

        List<Long> list = new ArrayList<Long>();// 泛型

        stringRedisTemplate.opsForValue().set("hello",value);
        return "ok";
    }


}
